<template>
  <keep-alive :include="cachedViews">
    <router-view :key="key" ref="view" v-bind="$attrs" v-on="$listeners" />
  </keep-alive>
</template>

<script>
export default {
  methods:{
    save(){
      return this.$refs.view.save && this.$refs.view.save()
    }
  },
  computed: {
    cachedViews() {
      return this.$store.getters['cachedViews']
    },
    key() {
      const { path } = this.$route;
      return path;
    }
  }
}
</script>

<style lang="less" scoped>
</style>